<!DOCTYPE html>
<html>
<head>
   <title>CSS Animations - animation-duration default</title>
   <link rel="author" title="Opera Software ASA" href="http://www.opera.com/">
   <link rel="help" href="http://dev.w3.org/csswg/css3-animations/#the-animation-duration-property-">
   <meta name="flags" content="dom">
   <meta name="assert" content="animation-duration does not inherit by default">
   <script src="/resources/testharness.js"></script>
   <script src="/resources/testharnessreport.js"></script>
   <style type="text/css">
      @keyframes move {
         from {
            left: 0px;
         }
         to {
            left: 50px;
         }
      }
      div {
         width: 50px;
         height: 100px;
         background: blue;
         position: relative;
      }
      .test {
         animation-duration: 1s;
      }
      .test, .test > div {
         animation-fill-mode: forwards;
         animation-name: move;
      }
   </style>
   <script type="text/javascript">
      setup({explicit_done:true});
      onload = function() {
         var testName = document.querySelector('title').firstChild.data;
         var divs = document.querySelectorAll('div');
         var log = document.querySelectorAll('p')[1].firstChild;
         var passed = false;
         setTimeout(function() {
            test(function(){assert_true(passed);}, testName);
            done();
            log.data = (passed ? 'PASS if the animation occurred.' : 'FAIL');
         }, 1500);
         divs[1].addEventListener('animationend', function() {
            var style = getComputedStyle(divs[1], null);
            var duration = style.getPropertyValue('animation-duration');
            passed = (duration == '0s' && style.left == '50px'
                      && getComputedStyle(divs[0], null).left != '50px');
         });
         divs[0].className = 'test';
      }
   </script>
   <style>iframe{display:none}</style>
</head>
<body>
   <p>Below there should be a single blue square gradually sliding right.</p>
   <p>Testing...</p>
   <div>
      <div></div>
   </div>
</body>
</html>
